Skip to content

Build: Move type checking and test suites to tox - #4494

Open
oresttokovenko wants to merge 2 commits into
apache:mainfrom
oresttokovenko:tox-typecheck-and-tests
Open

oresttokovenko wants to merge 2 commits into
apache:mainfrom
oresttokovenko:tox-typecheck-and-tests

Conversation

@oresttokovenko

@oresttokovenko oresttokovenko commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

What

This PR moves mypy type checking and the test suites out of Makefile and .pre-commit-config.yaml into a dedicated tox.toml, backed by tox-uv-bare (uv-venv-lock-runner) and PEP 735 [dependency-groups] in pyproject.toml. Makefile stays for setup, linting, docs, interactive notebooks, and clean; prek stays for formatting and fast linters.

  • Adds tox.toml with default env_list (typecheck and test-3.11–test-3.14) plus unit, integration, s3, adls, gcs, notebook, and coverage
  • Adds PEP 735 [dependency-groups] (lint, tox, types, coverage) in pyproject.toml and updates uv.lock, so every tox environment installs strictly from uv.lock
  • Removes mirrors-mypy from .pre-commit-config.yaml
  • Removes test/coverage targets from Makefile (retaining install*, lint, check-license, docs-*, notebook*, clean)
  • Updates .github/workflows/python-ci.yml, .github/workflows/python-integration.yml, dev/release/verify_rc.sh, MANIFEST.in, dev/.rat-excludes, AGENTS.md, mkdocs/docs/contributing.md, and mkdocs/docs/verify-release.md

Why

Following the Nov 24 community sync, this scopes the tooling cleanup down from #4208 to just testing and type checking using tox (rather than replacing Makefile and prek wholesale with nox and just).

Previously, test and type-checking logic was split across Makefile, .pre-commit-config.yaml, and the CI workflows:

  • mirrors-mypy pinned mypy and its types-* stubs outside pyproject.toml/uv.lock, so Dependabot's uv ecosystem did not bump them and local uv run could not reproduce the isolated CI mypy environment
  • CI duplicated platform workarounds (such as --no-extra hive-kerberos on Windows) and uv sync/pytest/coverage invocations across workflows and Makefile
  • With tox.toml + uv-venv-lock-runner, CI and local runs invoke the same environments with the same locked dependencies from uv.lock, and typecheck runs as its own fast job instead of hiding behind matrix.python == '3.11'

Where the old recipes and checks live now

Old command / hook Command now
mirrors-mypy (prek) uv run tox -e typecheck
make test uv run tox -e unit (or uv run tox -p for 3.11–3.14)
make test PYTEST_ARGS="..." uv run tox -e unit -- ...
make test-integration uv run tox -e integration (KEEP_COMPOSE=1 to keep containers up)
make test-s3 / test-adls / test-gcs uv run tox -e s3 / adls / gcs
make test-notebook uv run tox -e notebook
make coverage-report uv run tox -e coverage
make test-coverage COVERAGE=1 uv run tox -e unit,integration,s3,adls,gcs,coverage

make install, make lint, make check-license, make docs-serve, make docs-build, make notebook, make notebook-infra, and make clean remain in Makefile

Tests

  • uv lock --check passed
  • COVERAGE=1 COVERAGE_FAIL_UNDER=0 uv run --locked --only-group tox tox run -r -e typecheck,test-3.13,coverage -- tests/avro/test_decoder.py passed (typecheck: 0 issues across 222 files; test-3.13: 68 passed; coverage: combined and reported)
  • uv run --locked --only-group tox tox run --notest -e unit synced cleanly from uv.lock
  • uv run --locked --only-group lint prek run -a passed all 10 remaining hooks
  • zizmor reported 0 findings on .github/workflows/python-ci.yml and .github/workflows/python-integration.yml

@Fokko

Fokko commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Thanks @oresttokovenko for raising this PR, and joining the PyIceberg sync the other day. Sorry for the reviewing taking some time, but I wanted to take the time to dive into it, and let it sink in a bit.

I hate to be that guy that dismisses changes, but I want to make sure that we're heading into the right direction. Couple of things:

  • I'm hesitant of dropping the Makefile commands, since folks might rely on it in their infra. I think also that make test is easier to guess or remember than uv run tox -e unit.
  • Why the choice of tox? I know tox from back in the days, and I my personal experiences have been far from optimal. For example, for isolation, I think that Docker is a far better alternative. Beside that, I know that there is a lot of tooling out there, and picking one of them isn't easy. Looking at the downloads (not the best metric, I know), it seems that the glory days of tox are in the past: https://pypistats.org/packages/tox?smooth=true
  • Finally, I'd rather would like to see that we replace tools, rather than add new ones. Tox and uv have a certain overlap, wouldn't we be able to do everything in uv? Starting fixing the type-checker?

Again, I would also like to invite others to get their opinion.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants